home *** CD-ROM | disk | FTP | other *** search
- global gFlushObject
-
- on buttonHandler
- set thisButton to the castNum of sprite the clickOn
- set the castNum of sprite the clickOn to thisButton + 1
- updateStage()
- startTimer()
- set pressed to 1
- repeat while the mouseDown
- if rollOver(the clickOn) then
- if pressed = 0 then
- set the castNum of sprite the clickOn to thisButton + 1
- updateStage()
- set pressed to 1
- end if
- next repeat
- end if
- if pressed = 1 then
- set the castNum of sprite the clickOn to thisButton
- updateStage()
- set pressed to 0
- end if
- end repeat
- if pressed = 1 then
- repeat while the timer < 20
- end repeat
- set the castNum of sprite the clickOn to thisButton
- updateStage()
- end if
- return pressed
- end
-
- on toggleButtonHandler
- set thisButton to the castNum of sprite the clickOn
- set the castNum of sprite the clickOn to thisButton + 1
- updateStage()
- set pressed to 1
- repeat while the mouseDown
- if rollOver(the clickOn) then
- if pressed = 0 then
- set the castNum of sprite the clickOn to thisButton + 1
- updateStage()
- set pressed to 1
- end if
- next repeat
- end if
- if pressed = 1 then
- set the castNum of sprite the clickOn to thisButton
- updateStage()
- set pressed to 0
- end if
- end repeat
- return pressed
- end
-
- on buttonBarHandler barType, howManyButtons, size, border
- if barType = #Vertical then
- set input to the mouseV - the top of sprite the clickOn + 1
- else
- set input to the mouseH - the left of sprite the clickOn + 1
- end if
- set total to size + border
- set choice to howManyButtons
- repeat with x = 1 to howManyButtons - 1
- set max to x * total
- if input <= max then
- if input <= (max - border) then
- set choice to x
- else
- set choice to 0
- end if
- exit repeat
- end if
- end repeat
- flushBuffer()
- return choice
- end
-